//
//  TestView.swift
//  delegate
//
//  Created by macvivi on 2021/10/29.
//

import UIKit

protocol TestViewDelegate : class {
    func getLabelText(labelText:String) -> UIColor
}

class TestView: UIView {
    
    weak var delegate:TestViewDelegate?
    
    private let currentColor = UIColor.red
    
    @IBOutlet  private var label: UILabel!
    
    
    @IBAction func btnClick(_ sender: UIButton) {
        backgroundColor = delegate?.getLabelText(labelText: label.text!)
    }
    
    
}
